<!-- 收藏 -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>我的面试评分</title>
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!-- 样式 -->
    <link rel="stylesheet" href="../../css/style.css" />
    <!-- 主题（主要颜色设置） -->
    <link rel="stylesheet" href="../../css/theme.css" />
    <!-- 通用的css -->
    <link rel="stylesheet" href="../../css/common.css" />
</head>
<style>
    #swiper {
        overflow: hidden;
    }
    #swiper .layui-carousel-ind li {
        width: 10px;
        height: 10px;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0,0,0,.3);
        border-radius: 50%;
        background-color: #f7f7f7;
        box-shadow: 0 0 0px rgba(255,0,0,.8);
    }
    #swiper .layui-carousel-ind li.layui-this {
        width: 24px;
        height: 10px;
        border-width: 0;
        border-style: solid;
        border-color: rgba(0,0,0,.3);
        border-radius: 20px;
        background-color: rgba(145, 219, 255, 1);
        box-shadow: 0 0 0px rgba(255,0,0,.8);
    }

    .index-title {
        text-align: center;
        box-sizing: border-box;
        width: 980px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }
    /* 弹窗的基本样式 */
    .modal {
        position: fixed;
        z-index: 1;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0,0,0,0.4);
    }

    .modal-content {
        background-color: #fefefe;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 30%;
    }

    .close {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }

    .close:hover,
    .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }
    .layui-laypage .layui-laypage-count {
        padding: 0 10px;
    }
    .layui-laypage .layui-laypage-skip {
        padding-left: 10px;
    }
</style>
<body>

<div id="app">
    <!-- 轮播图 -->
    <div class="layui-carousel" id="swiper" :style='{"boxShadow":"0 0 6px rgba(246, 189, 188,.8)","margin":"22px auto 5px","borderColor":"rgba(0,0,0,.3)","borderRadius":"20px","borderWidth":"0","width":"100%","borderStyle":"solid"}'>
        <div carousel-item id="swiper-item">
            <div v-for="(item,index) in swiperList" :key="index">
                <img style="width: 100%;height: 100%;object-fit:cover;" :src="item.img" />
            </div>
        </div>
    </div>
    <!-- 轮播图 -->

    <!-- 标题 -->
    <div class="index-title" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"20px auto 0","borderColor":"rgba(149, 221, 255, 1)","backgroundColor":"rgba(67, 162, 205, 1)","color":"rgba(0, 0, 0, 1)","borderRadius":"4px","borderWidth":"5px","fontSize":"24px","borderStyle":"dashed ","height":"auto"}'>
        <span>USER / Interview Score</span><span>我的面试评分</span>
    </div>
    <!-- 标题 -->


<!--    面试列表-->
    <div class="Interview-list" style=" justify-content: center;
    align-items: center; width: 100%;padding: 20px;">



        <div class="Interview-box" style="background-color: #93D1FF; border-radius: 20px 20px 20px 20px;width: 60%;height:100px;display: flex;margin: 30px  250px ">
            <div class="inter-title" style="text-align: center;color: #FFFFFF;font-size: 30px;margin: 30px 0px 50px 50px;">
                面试标题
            </div>
            <div class="inter-info" style="color: #FFFFFF;font-size: 20px;display: flex; margin: 40px 0px 50px 50px;">

                <div >面试时间: </div>
                <div style="font-size: 18px;margin: 4px;">2024-05-06 10:00:00</div>

            </div>
            <div class="button-inter" style="background-color: #FFFFFF;border-radius: 20px 20px 20px 20px;width: 120px;height: 40px;margin: 25px 0px 150px 50px;text-align: center;padding-top: 15px;color: #93D1FF;font-size: 20px;margin-left: auto;cursor:pointer;" id="triggerBox" >开始评分</div>
        </div>

        <div class="Interview-box" style="background-color: #93D1FF; border-radius: 20px 20px 20px 20px;width: 60%;height:100px;display: flex;margin: 30px  250px ">
            <div class="inter-title" style="text-align: center;color: #FFFFFF;font-size: 30px;margin: 30px 0px 50px 50px;">
                JAVA后端面试
            </div>
            <div class="inter-info" style="color: #FFFFFF;font-size: 20px;display: flex; margin: 40px 0px 50px 50px;">

                <div >面试时间: </div>
                <div style="font-size: 18px;margin: 4px;">2024-05-05 14:00:00</div>

            </div>
            <div class="button-inter" style="background-color: #FFFFFF;border-radius: 20px 20px 20px 20px;width: 120px;height: 40px;margin: 25px 0px 150px 50px;text-align: center;padding-top: 15px;color: #93D1FF;font-size: 20px;margin-left: auto;cursor:pointer;" >98</div>
        </div>

        <!-- 弹窗内容，初始隐藏 -->
        <div id="ratingModal" class="modal" style="display:none;">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>面试评分</h2>
                <form id="ratingForm">
                    <label for="rating">请输入评分:</label>
                    <input type="number" id="rating" name="rating" min="1" max="100" required>
                    <br>
                    <button type="submit">提交评分</button>
                </form>
            </div>
        </div>

</div>


</div>


<!-- layui -->
<script src="../../layui/layui.js"></script>
<!-- vue -->
<script src="../../js/vue.js"></script>
<!-- 组件配置信息 -->
<script src="../../js/config.js"></script>
<!-- 扩展插件配置信息 -->
<script src="../../modules/config.js"></script>
<!-- 工具方法 -->
<script src="../../js/utils.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            // 轮播图
            swiperList: [{
                img: '../../img/banner.jpg'
            }],
            dataList: [],
            baseurl:''
        },
        filters: {
            newsDesc: function(val) {
                if (val) {
                    if (val.length > 200) {
                        return val.substring(0, 200).replace(/<[^>]*>/g).replace(/undefined/g, '');
                    } else {
                        return val.replace(/<[^>]*>/g).replace(/undefined/g, '');
                    }
                }
                return '';
            }
        },
        methods: {
            jump(url) {
                jump(url)
            }
        }
    })

    layui.use(['layer', 'element', 'carousel', 'laypage', 'http', 'jquery'], function() {
        var layer = layui.layer;
        var element = layui.element;
        var carousel = layui.carousel;
        var laypage = layui.laypage;
        var http = layui.http;
        var jquery = layui.jquery;

        var limit = 8;

        vue.baseurl = http.baseurl;
        // 获取轮播图 数据
        http.request('config/list', 'get', {
            page: 1,
            limit: 5
        }, function(res) {
            if (res.data.list.length > 0) {
                var swiperItemHtml = '';
                for (let item of res.data.list) {
                    if (item.name.indexOf('picture') >= 0 && item.value && item.value != "" && item.value != null) {
                        swiperItemHtml +=
                            '<div>' +
                            '<img class="swiper-item" style="width: 100%;height: 100%;object-fit:cover;" src="' + http.baseurl+item.value + '">' +
                            '</div>';
                    }
                }
                jquery('#swiper-item').html(swiperItemHtml);
                // 轮播图
                vue.$nextTick(() => {
                    carousel.render({
                        elem: '#swiper',
                        width: '100%',
                        height: '550px',
                        arrow: 'hover',
                        anim: 'default',
                        autoplay: 'true',
                        interval: '3000',
                        indicator: 'inside'
                    });

                })
            }
        });
        // 分页列表
        pageList();

        // 搜索按钮
        jquery('#btn-search').click(function(e) {
            pageList();
        });

        function pageList() {
            var param = {
                page: 1,
                limit: limit,
                type: 1,
                userid: localStorage.getItem('userid')
            }
            if (jquery('#name').val()) {
                param['name'] = jquery('#name').val() ? '%' + jquery('#name').val() + '%' : '';
            }
            // 获取列表数据
            http.request('storeup/list', 'get', param, function(res) {
                vue.dataList = res.data.list
                // 分页
                laypage.render({
                    elem: 'pager',
                    count: res.data.total,
                    limit: limit,
                    groups: 5,
                    layout: ["prev","page","next"],
                    theme: '#43A2CD',
                    jump: function(obj, first) {
                        //首次不执行
                        if (!first) {
                            http.request('storeup/list', 'get', param, function(res) {
                                vue.dataList = res.data.list
                            })
                        }
                    }
                });
            })
        }
    });


    document.getElementById("triggerBox").onclick = function() {
        document.getElementById("ratingModal").style.display = "block";
    }

    document.getElementsByClassName("close")[0].onclick = function() {
        document.getElementById("ratingModal").style.display = "none";
    }

    document.getElementById("ratingForm").onsubmit = function(e) {
        e.preventDefault(); // 阻止表单默认提交行为
        var ratingValue = document.getElementById("rating").value;

        // 这里可以添加你的逻辑，比如通过Ajax将评分发送到服务器
        console.log("提交的评分: " + ratingValue);

        // 禁用评分输入框，防止再次更改
        document.getElementById("rating").disabled = true;

        // 提交后关闭弹窗
        document.getElementById("ratingModal").style.display = "none";
    }

</script>
</body>
</html>
